/**
 *
 */
package com.naiterui.ehp.bs.emr.service;

import com.naiterui.common.repository.page.PageParamVO;
import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.emr.dto.MedicalRecordDetailDTO;
import com.naiterui.ehp.bs.emr.vo.patient.CaseFileResultVO;
import com.naiterui.ehp.bs.emr.vo.patient.CaseFileVO;
import com.naiterui.ehp.bs.emr.vo.patient.DocumentInitVO;
import com.naiterui.ehp.bs.emr.vo.patient.DocumentResultVO;
import com.naiterui.ehp.bs.emr.vo.patient.DocumentVO;
import com.naiterui.ehp.bs.emr.vo.patient.PatientCaseDetailVO;

/**
 * 患者病例业务逻辑接口
 *
 * @since 2.16
 */
public interface IPatientCaseService {
    /**
     * 初始化基本病情
     * IPatientCaseService.initDocument()
     *
     * @param patientId
     * @param familyId
     *
     * @return
     *
     * @throws BusinessException

     * @Date 2018年5月30日
     * @since 2.16
     */
    DocumentInitVO initDocument(Long patientId, Long familyId) throws BusinessException;

    /**
     * 保存基本病情
     * IPatientCaseService.saveDocument()
     *
     * @param patientId
     * @param familyId
     * @param paramVO
     *
     * @return
     *
     * @throws BusinessException

     * @Date 2018年5月30日
     * @since 2.18
     */
    DocumentResultVO saveDocument(Long patientId, Long familyId, DocumentVO paramVO) throws BusinessException;

    /**
     * 保存病例信息
     * IPatientCaseService.saveCaseFile()
     *
     * @param patientId
     * @param familyId
     * @param paramVO
     *
     * @return
     *
     * @throws BusinessException

     * @Date 2018年5月31日
     * @since 2.18
     */
    CaseFileResultVO saveCaseFile(Long patientId, Long familyId, CaseFileVO paramVO) throws BusinessException;

    /**
     * 发送病例信息
     * IPatientCaseService.sendCase()
     *
     * @param patientId
     * @param doctorId
     * @param caseId
     *
     * @throws BusinessException

     * @Date 2018年5月31日
     * @since 2.18
     */
    Integer sendCase(Long patientId, Long doctorId, String caseId) throws BusinessException;

    /**
     * 同步病例信息给医生
     * IPatientCaseService.syncCaseToDoctor()
     *
     * @param patientId
     * @param caseId
     *

     * @Date 2018年6月1日
     * @since 2.18
     */
    String syncCaseToDoctor(Long patientId, String caseId);


    /**
     * 分页获取指定医生病例
     *
     * @param patientId
     * @param pageVO
     *
     * @return
     */
    PageVO<PatientCaseDetailVO> getCasePageListByDoctor(Long patientId, Long doctorId, PageParamVO pageVO) throws BusinessException;


    /**
     * 分页获取病例
     *
     * @param patientId
     * @param pageVO
     *
     * @return
     */
    PageVO<PatientCaseDetailVO> getCasePageList(Long patientId,Long inquirerId, PageParamVO pageVO) throws BusinessException;

    /**
     * 获取患者关联的就诊人病例
     * @param patientId
     * @param pageVO
     * @return
     * @throws BusinessException
     */
    PageVO<PatientCaseDetailVO> getCaseByPatient(Long patientId, PageParamVO pageVO) throws BusinessException;

    /**
     * 获取病例详情
     * IPatientCaseService.getCaseDetail()
     *
     * @param patientId
     *
     * @return
     *
     * @Date 2018年6月1日
     * @since 2.18
     */
    PatientCaseDetailVO getCaseDetail(Long patientId, String caseId) throws BusinessException;


    /**
     * 增加医生白名单
     *
     * @param doctorId
     * @param caseId
     * @throws BusinessException
     */
    void addWhite(Long doctorId, String caseId) throws BusinessException;

    String caseSignPdfUrl(String recordId) throws BusinessException;

    PatientCaseDetailVO covertToCaseDetail(MedicalRecordDetailDTO s);

}
